Many storage devices include caches. In general, a cache can include high-speed memory which sits between the outer level storage (e.g., disk drives) and hosts that issue commands to store data into and retrieve data from the outer level storage. When the host requests data from the outer level storage, a controller can move a copy of the data from the outer level storage into the cache memory. The host is provided the data from the cache memory. If the host requests the data again and if the copy of the data still resides in the cache memory, the host is provided the data from the cache memory without the controller accessing the outer level storage. When the host stores data to the outer level storage, the controller can write the data into the cache, and the controller can move a copy of the data into the outer level storage. In some caches, the controller substantially simultaneously writes the data to the outer level storage (e.g., a write-through cache). In some caches, the controller writes the data to the outer level storage at a later time (e.g., a write-back cache).
Hosts commonly need to write the same data to large segments of the outer level storage. For example, during initialization, a host can zero-out an entire disk drive or logical unit (e.g., fill each block on the disk drive or logical unit with zeroes). Some data storage devices implement some or all of the SCSI command protocol. When writing to such devices, some hosts use the WRITE SAME SCSI command to zero-out large segments of the outer level storage. The WRITE SAME SCSI command is useful for zeroing-out large segments of the outer level storage because the command indicates a block of data to be written to each address of a range of logical block addresses by providing only a single copy of the block of data. In a conventional storage device, such a WRITE SAME command can result in a block of data being written to the cache memory for each address in the range of logical block addresses. Writing redundant data to the cache is undesirable because it is an inefficient use of the cache memory.